using System;
using System.Collections.Generic;

namespace JGSY.AI.DesktopUI.Services;

/// <summary>
/// 主题服务接口
/// </summary>
public interface IThemeService
{
    /// <summary>
    /// 当前主题名称
    /// </summary>
    string CurrentTheme { get; }

    /// <summary>
    /// 获取所有可用主题
    /// </summary>
    IEnumerable<ThemeInfo> GetAvailableThemes();

    /// <summary>
    /// 应用主题
    /// </summary>
    /// <param name="themeName">主题名称</param>
    void ApplyTheme(string themeName);

    /// <summary>
    /// 切换到下一个主题
    /// </summary>
    void SwitchToNextTheme();

    /// <summary>
    /// 加载自定义主题
    /// </summary>
    /// <param name="themeConfig">主题配置</param>
    void LoadCustomTheme(CustomThemeConfig themeConfig);

    /// <summary>
    /// 保存当前主题设置
    /// </summary>
    void SaveCurrentTheme();

    /// <summary>
    /// 主题改变事件
    /// </summary>
    event EventHandler<string> ThemeChanged;
}

/// <summary>
/// 主题信息
/// </summary>
public class ThemeInfo
{
    public string Name { get; set; } = string.Empty;
    public string DisplayName { get; set; } = string.Empty;
    public string Description { get; set; } = string.Empty;
    public bool IsCustom { get; set; } = false;
}

/// <summary>
/// 自定义主题配置
/// </summary>
public class CustomThemeConfig
{
    public string Name { get; set; } = string.Empty;
    public string DisplayName { get; set; } = string.Empty;
    public string Description { get; set; } = string.Empty;
    public ThemeColors Colors { get; set; } = new();
}

/// <summary>
/// 主题颜色配置
/// </summary>
public class ThemeColors
{
    public string WindowBackground { get; set; } = "#FFFFFF";
    public string TitleBarBackground { get; set; } = "#F5F5F5";
    public string TitleBarBorder { get; set; } = "#E0E0E0";
    public string TitleBarForeground { get; set; } = "#333333";
    public string ContentBackground { get; set; } = "#FFFFFF";
    public string ContentForeground { get; set; } = "#333333";
    
    // 渐变支持
    public string? TitleBarGradientStart { get; set; }
    public string? TitleBarGradientEnd { get; set; }
    public string? WindowGradientStart { get; set; }
    public string? WindowGradientEnd { get; set; }
}
